import  jsonschema

json_data = {
    "success": True,
    "code": 10000,
    "mobile":"13112345678"

}

schema = { "type": "object",
           "properties":{
            "success": {"pattern":"e$"},
            "code": {"pattern":"^[0-1]{5}$"},
            "mobile":{"pattern":"[0-9]{11}"}
                          },
            "luckyNumber": {"type":"array"},
           "required":["success","code"]
           }

res = jsonschema.validate(instance=json_data, schema=schema)
print("检查结果是：", res)
